var YOP = YOP || {};
YOP.appDL = (function(){
	function handleEvents(){
		$("#wechart-mask-close").click(function() {
			$("#wechart-tip").hide();
		});
	}

	function isWeChart(){
		var wechat = navigator.userAgent.indexOf('MicroMessenger');
		if(wechat != -1) {
			$("#wechart-tip").show();
		}
	}

	function resize(){
		$(window).resize(function(event) {
			setHeight();
		});
	}
	function setHeight(){
		var width = $(window).width();
		var height = $(window).height();
		if (width > height) {
			$(".main").css("height","50.4rem");
		}else{
			$(".main").css("height","100%");
		}
	}
	return {
		init: function() {
			handleEvents();
			isWeChart();
			setHeight();
			resize();
		}
	};
})();
$(function(){
	YOP.appDL.init();
});